package com.gxa.question.controller;

import com.gxa.common.R;
import com.gxa.common.entity.platform_maintenance_service1001.QuestionClassification;
import com.gxa.question.service.QuestionClassificationService;
import org.omg.CORBA.PUBLIC_MEMBER;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

import java.util.Date;
import java.util.List;

@RestController
@RequestMapping("/questionClassification")
public class QuestionClassificationController {

    @Autowired
    private QuestionClassificationService questionClassificationService;

    /**
     * 1.按照分页查询
     * @param currentPage
     * @param pageSize
     * @return
     */
    @GetMapping("/questionClassificationByPage")
    public R questionClassificationByPage(Integer currentPage,Integer pageSize){
        return questionClassificationService.questionClassificationByPage(currentPage,pageSize);
    }

    /**
     * 2.添加问题列表
     * @param questionClassification
     * @return
     */
    @PostMapping("/addQuestionClassification")
    public R addQuestionClassification(@RequestBody QuestionClassification questionClassification){
        return questionClassificationService.addQuestionClassification(questionClassification);
    }

    /**
     * 3.编辑问题列表
     * @param questionClassification
     * @return
     */
    @PostMapping("/updateQuestionClassification")
    public R updateQuestionClassification(@RequestBody QuestionClassification questionClassification){
        return questionClassificationService.updateQuestionClassification(questionClassification);
    }

    /**
     * 4.根据id批量删除问题列表
     * @return
     */
    @GetMapping("/delQuestionClassificationByIds")
    public R delQuestionClassificationByIds(@RequestParam List<Integer> ids){

        return questionClassificationService.delQuestionClassificationByIds(ids);
    }

    /**
     * 5.根据条件查询
     * @return
     */
    @PostMapping("/selectQuestionClassification")
    public R selectQuestionClassification(@RequestBody QuestionClassification questionClassification){
        return questionClassificationService.selectQuestionClassification(questionClassification);
    }

    /**
     * 6.根据问题分类查询
     * @param question_classification
     * @return
     */
    @GetMapping("/selectQuestionClassificationByQuestionClassification")
    public R selectQuestionClassificationByQuestionClassification(String question_classification){
        return questionClassificationService.selectQuestionClassificationByQuestionClassification(question_classification);
    }







}
